// 用户相关接口
import axios from '../interceptors.js'

// 用户登陆
export const login = (data) => {
  return axios({
    url: '/user/login',
    method: 'post',
    data,
    timeout: 600000000
  })
}

// 用户登出
export const logout = (data) => {
  return axios({
    url: '/user/logout',
    method: 'post',
    data
  })
}

// 用户信息
export const getAccount = (data) => {
  return axios({
    url: '/user/account-info/get',
    params: data,
    timeout: 600000000
  })
}

// 用户注册
export const register = (data) => {
  return axios({
    url: '/user/register',
    method: 'post',
    data
  })
}

// 修改密码
export const changePassword = (data) => {
  return axios({
    url: '/user/change-password',
    method: 'post',
    data
  })
}

// 获取menu
export const getMenu = () => {
  return axios({
    url: '/user/menu/get'
  })
}

// 获取订阅菜单
export const getSubscribeMenu = () => {
  return axios({
    url: '/user/subscribe/menu/get'
  })
}

// 更新订阅菜单
export const updateSubscribeMenu = (data) => {
  return axios({
    url: '/user/subscribe/menu/update',
    method: 'put',
    data
  })
}
